wayland: Don't accept the "TARGETS" target on the wl_data_offer
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 19 Mar 2015 14:49:04 +0000 (15:49 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Thu, 19 Mar 2015 15:05:04 +0000 (16:05 +0100)
This is handled separately through the data already cached from the
wl_data_offer.offer handler, we can avoid this request entirely then.

gdk/wayland/gdkselection-wayland.c

index 651785a3ed7f71d3c6b2f97d8da1d0be9f20ab33..4ba016a8ce0432dd7e3849ca62f3c23530e24ee8 100644 (file)
@@ -896,9 +896,10 @@ _gdk_wayland_display_convert_selection (GdkDisplay *display,
       return;
     }
 
-  wl_data_offer_accept (wayland_selection->offer,
-                        _gdk_wayland_display_get_serial (GDK_WAYLAND_DISPLAY (display)),
-                        gdk_atom_name (target));
+  if (target != gdk_atom_intern_static_string ("TARGETS"))
+    wl_data_offer_accept (wayland_selection->offer,
+                          _gdk_wayland_display_get_serial (GDK_WAYLAND_DISPLAY (display)),
+                          gdk_atom_name (target));
 
   buffer_data = g_hash_table_lookup (wayland_selection->selection_buffers,
                                      target);